<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="hexinyang">		
		<title>不记名卡售卡坏卡登记</title>
		<script language="javascript" type="text/javascript" src="../script/print.js"></script>
		<script language="javascript" type="text/javascript" src="../script/pivot.js"></script>
		<script language="javascript" src="../script/common.js" type="text/javascript"></script>
		<script language="javascript" src="../script/card.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
	var gotoIssue;
	var billBack = false;
	function load(){
		Eui.showNavigation();
		setPages(["readcardview","detview"]);
		var asn = getPara("asn");
		if (asn)
			readCardForm.asn.value = asn;
		gotoIssue = getPara("gotoIssue");
		initActiveX();
	}
	
	function onReadCard(){
		var asn;
		try{
			getCard();
			asn = getAsn();
			readCardForm.asn.readOnly = true;
			readCardForm.asn.className = "readonly";
		}catch(e){showError(e.description);return;}
		readCardForm.asn.value = asn;
	}
	
	function onSearch(){
		if (!checkForm(readCardForm)) return;
		var asn = readCardForm.asn.value;
		DWR.call("mgntQueryService.checkBadAnonCardReg",asn,function(data){
			$("regBadCardBtn").disabled = false;
			readCardForm.asn.readOnly = true;
			readCardForm.asn.className = "readonly";
		},{blockScreen:true});
	}
	
	function onCancel(){
		if (gotoIssue && billBack){
			document.location.href = "issue_anon_card.html"
		}else{
			switchPage("readcardview");
			$("regBadCardBtn").disabled = true;
			readCardForm.reset();
			readCardForm.asn.readOnly = false;
			readCardForm.asn.className = "";
		}
	}
	
	function regBadCard(){
		var asn = readCardForm.asn.value;
		if (!showQuestion("是否登记坏卡"+asn+"？")) {onCancel();return;}
		DWR.call("cardMgntService.regBadAnonCard",asn,function(data){
			showInformation("不记名卡"+asn+"售卡损坏登记成功！");
			switchPage("detview");
			CardMgnt.showPrintView("detview","bad_anoncard_reg_bill",data.logId,"不记名卡售卡损坏登记");
			billBack = true;
		},{blockScreen:true})
	}
	
		</script>
	</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
		
	<div id="readcardview">
		<div id="bindinfodiv">
			<div class="form">
				<div class="formTitle">读不记名卡或输入不记名卡卡号</div>
				<form id="readCardForm" name="readCardForm">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="label4">
						<tr>
							<td><label>卡 号</label> <input type="text" name="asn" onblur="checkV(this,'asn',true)"><span class="des">*</span>
								<button onclick="onReadCard()">读 卡</button>
							</td>
							<td>
								<button onclick="onSearch()">查 询</button>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<p>
			<button id="regBadCardBtn" onclick="regBadCard()" disabled>坏卡登记</button>
			<button onclick="onCancel()">重 置</button>
		</p>
	</div>

	<div id="detview" style="display:none;">
	</div>
</body>
</html>